\documentclass{article}
\newcommand{\AAA}{123}
\providecommand{\AAA}{456}	% should not do anything
\begin{document}
\AAA
\end{document}

